<template>
  <el-form>
    <el-row>
      <el-row>
        <el-col :span="18">
          <span>学生数量</span>
        </el-col>
        <el-col :span="6">
          <span>1000人</span>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="18">
          <span>完成测评数量</span>
        </el-col>
        <el-col :span="6">
          <span>1000人</span>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="18">
          <span>未完成测评数量</span>
        </el-col>
        <el-col :span="6">
          <span>1000人</span>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="18">
          <span>心理教师数量</span>
        </el-col>
        <el-col :span="6">
          <span>1000人</span>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="18">
          <span>测评数据总量 </span>
        </el-col>
        <el-col :span="6">
          <span>1000份</span>
        </el-col>
      </el-row>
    </el-row>
    <el-row>
      <el-row>
        <h3>心理辅导年级分布</h3>
      </el-row>
      <el-row>
        <h1>心理辅导各校人数分布</h1>
      </el-row>
      <el-row>
        <h1>心理辅导各校人数分布</h1>
      </el-row>
      <el-row>
        <div id="schoolBar" style="height:300px;"></div>
      </el-row>
      <el-row>
        <h1>心理辅导各样占比分布</h1>
      </el-row>
      <el-row>
        <div id="schoolPie" style="height:300px;"></div>
      </el-row>
    </el-row>
  </el-form>
</template>

<script>
import { mapGetters } from "vuex";
import * as echarts from "echarts";
export default {
  name: "thirdRegister",
  data() {
    return {};
  },
  computed: {
    ...mapGetters(["userInfo"])
  },
  created() {},
  mounted() {
    this.getSchoolBarInfo();
    this.getSchoolPieInfo();
  },
  methods: {
    getSchoolPieInfo() {
      var chartDom = document.getElementById("schoolPie");
      var myChart = echarts.init(chartDom);
      var option;
      option = {
        title: {
          text: "某站点用户访问来源",
          subtext: "纯属虚构",
          left: "center"
        },
        tooltip: {
          trigger: "item"
        },
        legend: {
          orient: "vertical",
          left: "left"
        },
        series: [
          {
            name: "访问来源",
            type: "pie",
            radius: "50%",
            data: [
              { value: 1048, name: "搜索引擎" },
              { value: 735, name: "直接访问" },
              { value: 580, name: "邮件营销" },
              { value: 484, name: "联盟广告" },
              { value: 300, name: "视频广告" }
            ],
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: "rgba(0, 0, 0, 0.5)"
              }
            }
          }
        ]
      };

      option && myChart.setOption(option);
    },
    getSchoolBarInfo() {
      var chartDom = document.getElementById("schoolBar");
      var myChart = echarts.init(chartDom);
      var option;
      option = {
        xAxis: {
          type: "category",
          data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
        },
        yAxis: {
          type: "value"
        },
        series: [
          {
            data: [120, 200, 150, 80, 70, 110, 130],
            type: "bar"
          }
        ]
      };

      option && myChart.setOption(option);
    }
  }
};
</script>
